<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>
<!--header-->

<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 门店/院线推荐信息</h3>
        <div class="row mt">
            <div class="col-md-12">
                <div class="content-panel">
                    <table class="table table-striped table-advance table-hover">
                        <h4><i class="fa fa-angle-right"></i> 门店/院线推荐信息列表
                            <a href="{:U('forms',array('type_id'=>$lei['id'],'currpage'=>$currpage))}" class="btn btn-theme btn-default" style="margin-left: 40px">添加门店/院线推荐</a>
                        </h4>
                        <hr>
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>展示图</th>
                            <th>分类名称</th>
                            <th>展示课程标题</th>
                            <th>手机号</th>
                            <th>简介</th>
                            <th>修改时间</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="list" item="v">
                            <tr>
                                <td>{$v.id}</td>
                                <td>
                                    <if condition = "$v['img'] == NULL">
                                        <a  title="暂无图" class="fancybox" href="__PUBLIC__/img/wutu.png">
                                            <img class="img-responsive" src="__PUBLIC__/img/wutu.png" style="width: 60px;height: 60px;border-radius: 50%">
                                        </a>
                                        <else/>
                                        <a class="fancybox" href="{$v.img}">
                                            <img class="img-responsive" src="{$v.img}" style="width: 60px;height: 60px;border-radius: 50%">
                                        </a>
                                    </if>
                                </td>
                                <td>{$v.lei_name}</td>
                                <td>{$v.ke_name}</td>
                                <td>{$v.phone}</td>
                                <td>
                                    <input type="text" value="{$v.content}" title="{$v.content}">
                                </td>
                                <td><if condition="$v['up_at'] != NULL">{$v.up_at|date="Y-m-d H:i:s",###}<else/>无</if></td>
                                <td>{$v.create_at|date="Y-m-d H:i:s",###}</td>
                                <td>
                                    <a  title="修改" href="{:U('forms',array('id'=>$v['id'],'currpage'=>$currpage))}" class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></a>
                                    <if condition="QUAN eq 2 || QUAN eq 3">
                                    <button  title="删除" onclick="dels({$v.id},23)" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i></button>
                                    </if>
                                </td>
                            </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </section>
</section>

</section>
<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
    $(function() {
        //    fancybox
        jQuery(".fancybox").fancybox();
    });
</script>
<script>
    //custom select box
    $(function(){
        $('select.styled').customSelect();
    });
    //跳转页数检测
    $("#tiao").click(function () {
        if(document.frmss.currpage.value == "" || document.frmss.currpage.value > {$totalpage} || document.frmss.currpage.value < 1){
            return false;
        }
    })
</script>
<script>
    function dels(id,type) {
        var currpage = "{$currpage}";
        if(id > 0){
            layer.confirm('确认要删除该信息吗？删除后不可恢复！', {
                title: '删除提示：',
                btn: ['确定'] //可以无限个按钮
            }, function(index, layero){
                $.ajax({
                    type:"post",
                    data:{id:id,type:type},
                    url:"{:U('Del/del')}",
                    success:function (res) {
                        if(res.status == 1){
                            layer.open({
                                title: '',
                                content: "删除成功",
                            });
                            if(currpage == 1){
                                location.href="__APP__/Dashboard/Beauty/info";
                            }else{
                                location.href="__APP__/Dashboard/Beauty/info/currpage/"+currpage;
                            }
                        }
                        if(res.status == 2){
                            layer.open({
                                title: ''
                                ,content: "删除失败"
                            });
                            _pass = false;
                        }
                    }
                })
            });
        }
    }
</script>
</body>
</html>
